/**
 * @param {string} s
 * @param {string} t
 * @return {string}
 * 
 * 匹配字符串的长度没有判断
 */
var minWindow = function (s, t) {
    if (t.length > s.length) return '';
    if(s === t)return s;
    let str = '';
    const len = t.length;
    let i = 0;
    let j = len;
    while (j <= s.length) {
        const target = s.slice(i, j).split('')
        const isSome = t.split('').some(a => target.includes(a))
        if (!isSome) {
            i = j;
            j = j + 1;
        } else {
            const isInclude = t.split('').every(a => target.includes(a))
            if (isInclude) {
                if (!str || str.length > target.length) {
                    str = target.join('')
                }
                i = j;
                j = j + 1;
            } else {
                j++;
            }
        }
    }
    return str;
};
minWindow('aa', 'aa')